#include "znx_execinfo.h"
#include "znx_defs.h"

void
print_stack()
{
    int     size = 16;
    void    *array[16];

    int stack_num = backtrace(array, size);
    char **stacktrace = backtrace_symbols(array, stack_num);
    for (int i = 0; i < stack_num; i++) {
        printf("%d: %s\n", i, stacktrace[i]);
    }
    free(stacktrace);
}